package com.cxylk;

import java.io.IOException;

/**
 * @Classname Main
 * @Description TODO
 * @Author likui
 * @Date 2021/4/22 21:23
 **/
public class Main {
    public static void main(String[] args) {
        Cmd cmd=Cmd.parse(args);
        if(!cmd.ok||cmd.helpFlag){
            System.out.println("Usage: <main class> [-options] class [args...]");
            return;
        }
        if(cmd.versionFlag){
            System.out.println("java version \"1.8.0\"");
            return;
        }
        startJVM(cmd);
    }

    private static void startJVM(Cmd cmd){
        System.out.printf("classpath:%s class:%s args:%s\n",cmd.classpath,cmd.getMainClass(),cmd.getAppArgs());
    }
}
